﻿<div class="module-container">
    <div class="search-panel">
        <form class="form-inline search-table">
            <div class="form-group">
                <input class="form-control w200px" name="name" type="text"
                       placeholder="按姓名/电话/身份证号查询">
            </div>
            <div class="form-group">
                <input class="form-control" name="trade_no" type="text"
                       placeholder="请输入订单号查询">
            </div>
            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" data-width="200px" name="trade_state"
                        data-has-text-field="false">
                    @Html.EmptyOption("全部状态")
                    <option value="SUCCESS" selected>支付成功</option>
                    <option value="NOTPAY">未支付</option>
                    <option value="CLOSED">已关闭</option>
                    <option value="REVOKED">已撤销</option>
                    <option value="USERPAYING">用户支付中</option>
                    <option value="REFUND">转入退款</option>
                    <option value="PAYERROR">支付失败</option>
                </select>
            </div>

            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" data-width="200px" name="order_type"
                        data-has-text-field="false">
                    @Html.EmptyOption("全部支付类型")
                    <option value="NULL">线上支付</option>
                    <option value="1">线下支付</option>
                </select>
            </div>

            <div class="input-group date uidate">
                <input class="form-control w200px" name="start_date" type="text" placeholder="请选择交易开始日期" title="请选择交易开始日期">
                <span class="input-group-addon">
                    <i class="glyphicon glyphicon-th"></i>
                </span>
            </div>
            <div class="input-group date uidate">
                <input class="form-control w200px" name="end_date" type="text" placeholder="请选择交易结束日期" title="请选择交易结束日期">
                <span class="input-group-addon">
                    <i class="glyphicon glyphicon-th"></i>
                </span>
            </div>

            <button class="btn btn-primary" type="submit">
                <i class="fa fa-search"></i> 查询
            </button>

            <a class="btn btn-default" id="table_export" data-url="@Url.Action("Export")">
                <i class="fa fa-share-square-o"></i> 导出
            </a>

        </form>
    </div>
    <div class="uitable" data-url="@Url.Action("Grid")">
        @Html.Action("Grid",new { trade_state= "SUCCESS" })
    </div>
</div>

<script>

    $('#table_export').on('click', function () {
        var url = $(this).data('url') + '?' + $.param(fx.serializeForm($('.search-table')));
        window.location.href = url;
    });
</script>